/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MODEL;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;

/**
 *
 * @author Irene & Morten
 */
public class Shopping extends Observable implements Serializable {

    
    private ArrayList<String> monday;
    private ArrayList<String> tuesday;
    private ArrayList<String> wednesday;
    private ArrayList<String> thursday;
    private ArrayList<String> friday;
    private ArrayList<String> saturday;
    private ArrayList<String> sunday;
    private ArrayList<String> standard;
   
   

    public Shopping() {
        monday = new ArrayList<String>();
        tuesday = new ArrayList<String>();
        wednesday = new ArrayList<String>();
        thursday = new ArrayList<String>();
        friday = new ArrayList<String>();
        saturday = new ArrayList<String>();
        sunday = new ArrayList<String>();
        standard = new ArrayList<String>();
   
   

    }

    /* adds mondaygroceries to a list monday and notifies observers
     * @param groceries is the objects to be added
     */
    public void addMondayGrocery(List<String> groceries) {
       groceries.removeAll(monday);
        monday.addAll(groceries);
        setChanged();
        notifyObservers();

    }

    public void addTuesdayGrocery(List<String> groceries) {
       groceries.removeAll(tuesday);
        tuesday.addAll(groceries);
        setChanged();
        notifyObservers();

    }

    public void addWednesdayGrocery(List<String> groceries) {
      
         groceries.removeAll(wednesday);
        wednesday.addAll(groceries);
         setChanged();
        notifyObservers();

    }

    public void addThursdayGrocery(List<String> groceries) {
        groceries.removeAll(thursday);
        thursday.addAll(groceries);
        setChanged();
        notifyObservers();

    }

    public void addFridayGrocery(List<String> groceries ) {
        groceries.removeAll(friday);
        friday.addAll(groceries);
        setChanged();
        notifyObservers();

    }

    public void addSaturdayGrocery(List<String> groceries) {
        groceries.removeAll(saturday);
        saturday.addAll(groceries);
        setChanged();
        notifyObservers();

    }

    public void addSundayGrocery(List<String> groceries) {
         groceries.removeAll(sunday);
        sunday.addAll(groceries);
        setChanged();
        notifyObservers();
    }

    public void addToStandard(List<String> groceries) {
       
       groceries.removeAll(standard);
       standard.addAll(groceries);
       setChanged();
        notifyObservers();
    }

   
   
    /* removes the groceries from the standardlist and notifies observers
     *@param grocery is the object to be removed
     */

    public void removeFromStandard(String grocery) {
        standard.remove(grocery);
        setChanged();
        notifyObservers();
    }

    public ArrayList<String> getFriday() {
        return friday;
    }

    public ArrayList<String> getMonday() {
        return monday;
    }

    public ArrayList<String> getSaturday() {
        return saturday;
    }

    public ArrayList<String> getStandard() {
        return standard;
    }

    public ArrayList<String> getSunday() {
        return sunday;
    }

    public ArrayList<String> getThursday() {
        return thursday;
    }

    public ArrayList<String> getTuesday() {
        return tuesday;
    }

    public ArrayList<String> getWednesday() {
        return wednesday;
    }

    /*removes the mondaylist from the list monday
     * @param s is the string to be removed
     */
    public void removeMonday(String s) {
        monday.remove(s);
        setChanged();
        notifyObservers();
    }

    public void removeTuesday(String s) {
        tuesday.remove(s);
        setChanged();
        notifyObservers();
    }

    public void removeWednesday(String s) {
        wednesday.remove(s);
        setChanged();
        notifyObservers();

    }

    public void removeThursday(String s) {
        thursday.remove(s);
        setChanged();
        notifyObservers();
    }

    public void removeFriday(String s) {
        friday.remove(s);
        setChanged();
        notifyObservers();
    }

    public void removeSaturday(String s) {
        saturday.remove(s);
        setChanged();
        notifyObservers();
    }

    public void removeSunday(String s) {
        sunday.remove(s);
        setChanged();
        notifyObservers();
    }

}
